//
//  WarningPlayerView.m
//  2046
//
//  Created by 勇拓 李 on 16/3/22.
//  Copyright © 2016年 2046. All rights reserved.
//

#import "WarningPlayerView.h"
#import "AppDelegate.h"

@interface WarningPlayerView()
@property (weak, nonatomic) IBOutlet UILabel *label_notice;

@end

@implementation WarningPlayerView

- (void)awakeFromNib
{
    [super awakeFromNib];
    self.layer.cornerRadius = 5.f;
}

- (void)soundsAlert:(NSInteger )type
{
    self.frame = CGRectMake((SCREEN_WIDTH - 120)/2, (SCREEN_HEIGHT - 120 - 64)/2, 120, 120);
    
    if (type == TIME_TOO_SHORT) {
        _label_notice.text = @"说话时间太短";
    }
    else
    {
        _label_notice.text = @"不能超过30秒";
    }
    
    [[AppDelegate getMainWindow] addSubview:self];
    
    [self performSelector:@selector(delaydelete) withObject:nil afterDelay:0.5f];
}

- (void)delaydelete
{
    [self removeFromSuperview];
}

@end
